https://cloud.tencent.com/developer/article/1499135
<style>
    .container *{
      padding: 0;
      margin: 0;
    }
    .container {
      position: relative;
      width: 400px;
      margin: 50px auto;
    }
    
    .container input {
      display: none;
    }
    
    .nav {
      position: relative;
      overflow: hidden;
    }
    
    .nav li {
      width: 200px;
      float: left;
      text-align: center;
      background: #ddd;
      list-style: none;
    }
    
    .nav li label {
      display: block;
      width: 200px;
      line-height: 36px;
      font-size: 18px;
      cursor: pointer;
    }
    
    .content {
      position: relative;
      overflow: hidden;
      width: 400px;
      height: 100px;
      border: 1px solid #999;
      box-sizing: border-box;
      padding: 10px;
    }
    
    .content1,
    .content2 {
      display: none;
      width: 100%;
      height: 100%;
    }
    
    .nav1:checked ~ .nav li {
      background: #ddd;
      color: #000;
    }
    .nav1:checked ~ .nav li:first-child {
      background: #ff7300;
      color: #fff;
    }
    
    .nav2:checked ~ .nav li {
      background: #ddd;
      color: #000;
    }
    .nav2:checked ~ .nav li:last-child {
      background: #ff7300;
      color: #fff;
    }
    
    .nav1:checked ~ .content > div {
      display: none;
    }
    .nav1:checked ~ .content > div:first-child {
      display: block;
    }
    
    .nav2:checked ~ .content > div {
      display: none;
    }
    .nav2:checked ~ .content > div:last-child {
      display: block;
    }
    
    .nav li.active {
      background: #ff7300;
      color: #fff;
    }
    
    .content .default {
      display: block;
    }
    </style>
    <div class="container">
      <input class="nav1" id="li1" type="radio" name="nav">
      <input class="nav2" id="li2" type="radio" name="nav">
      <ul class='nav'>
        <li class='active'><label for="li1">tab1</label></li>
        <li><label for="li2">tab2</label></li>
      </ul>
      <div class="content">
        <div class="content1 default">tab1 内容:123456</div>
        <div class="content2">tab2 内容:abcdefgkijkl</div>
      </div>
    </div>